from sklearn.preprocessing import LabelEncoder
import numpy as np
import matplotlib.pyplot as plt

x = np.array([
    'a',
    'b',
    'a',
    'b',
    'a',
])

le = LabelEncoder()
x_labeled = le.fit_transform(x)
print(x_labeled)
x_orig = le.inverse_transform(x_labeled)
print(x_orig)
print(le.classes_)
